package com.ejuornal.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ejuornal.bean.Page;
import com.ejuornal.bean.PermissionGroup;
import com.ejuornal.dao.PermissionDao;
import com.ejuornal.dao.PermissionGroupDAO;
import com.ejuornal.service.PermissionGroupService;
@Component("permissionGroupService")
public class PermissionGroupServiceImpl implements PermissionGroupService{
    private PermissionGroupDAO permissionGroupDao;
    
    public void add(PermissionGroup pg) {
        String sql = "insert into t_permission_group(pgName) value(?)";
        permissionGroupDao.add(sql, new Object[]{pg.getPgName()});
    }
    
    public Page<PermissionGroup> find(int current_record, String url) {
        return permissionGroupDao.find(current_record, url);
    }
    
    public PermissionGroupDAO getPermissionGroupDao() {
        return permissionGroupDao;
    }
    @Resource(name="permissionGroupDao")
    public void setPermissionGroupDao(PermissionGroupDAO permissionGroupDao) {
        this.permissionGroupDao = permissionGroupDao;
    }

    public boolean delete(int pgId) {
        return permissionGroupDao.delete(pgId);
    }

	@Override
	public boolean batchUpdate() {
		return permissionGroupDao.batchUpdate();
	}
}
